<?php
$text = '1dqwdwq';
$a = (int)$text;
echo $a;